package com.xxxx.business.controller.web;


import com.xxxx.server.dto.CategoryDto;
import com.xxxx.server.dto.ResponseDto;
import com.xxxx.server.service.CategoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController("webCategoryController")
@RequestMapping("/web/category")
public class CategoryController {

    public static final String BUSINESS_NAME = "分类";

    @Resource
    private CategoryService categoryService;

    /**
     * 查询所有分类
     * @return
     */
    @GetMapping("/all")
    public ResponseDto all() {
        ResponseDto<List<CategoryDto>> responseDto = new ResponseDto<>();

        responseDto.setContent(categoryService.all());
        return responseDto;
    }
}
